/**
 * 
 */
package com.gr.experimental.reasoner.impl;

import java.util.Collection;
import java.util.List;

import com.gr.experimental.model.MFrag;
import com.gr.experimental.reasoner.MEBNReasonerEventHandler;
import com.gr.experimental.reasoner.MEBNReasonerSession;

/**
 * @author Karol Banczyk
 *
 */
public class SimpleSession implements MEBNReasonerSession {

	SimpleReasoner reasoner;
	List<MEBNReasonerEventHandler> handlers;
	
	/**
	 * @param reasoner
	 */
	public SimpleSession(SimpleReasoner reasoner) {
		this.reasoner = reasoner;
	}

	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.reasoner.MEBNReasonerSession#executeQuery(java.util.Collection, java.util.Collection)
	 */
	@Override
	public void executeQuery(Collection<MFrag> findings, Collection<MFrag> query) {
		
		// HERE WE CAN PLACE THE SSBN CONSTRUCTION ALGORITHM
		// + BN INFERENCE
		
		
	}

	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.reasoner.MEBNReasonerSession#registerEventHandler(com.gr.experimental.reasoner.MEBNReasonerEventHandler)
	 */
	@Override
	public void registerEventHandler(MEBNReasonerEventHandler handler) {
		handlers.add(handler);
	}

	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.reasoner.MEBNReasonerSession#unregisterEventHandler(com.gr.experimental.reasoner.MEBNReasonerEventHandler)
	 */
	@Override
	public void unregisterEventHandler(MEBNReasonerEventHandler handler) {
		handlers.remove(handler);
	}

	/**
	 * {@inheritDoc}
	 * @see com.gr.experimental.reasoner.MEBNReasonerSession#release()
	 */
	@Override
	public void release() {
		reasoner.removeSession(this);
	}

}
